//
//  MACompleteStatusCell.m
//  meiang_edu
//
//  Created by 栋 on 2019/1/8.
//  Copyright © 2019年 com.meiang.meiang_edu. All rights reserved.
//

#import "MACompleteStatusCell.h"
#import "UIImageView+MAOSS.h"
#import "MaTool.h"
@interface MACompleteStatusCell()

/**
 头像
 */
@property (weak, nonatomic) IBOutlet UIImageView *imgHeader;

/**
 姓名
 */
@property (weak, nonatomic) IBOutlet UILabel *lblName;

/**
 班级信息
 */
@property (weak, nonatomic) IBOutlet UILabel *lblClass;

/**
 性别
 */
@property (weak, nonatomic) IBOutlet UIImageView *imgGender;


@end

@implementation MACompleteStatusCell

- (void)setDataWithModel:(MACompleteStatusModel *)model indexPath:(NSIndexPath *)indexPath{
    _lblName.text = model.cname;
    
    if ([model.cgender isEqualToString:@"女"]) {
        self.imgGender.image = [UIImage imageNamed:@"woman_sign"];
    }else{
        self.imgGender.image = [UIImage imageNamed:@"mansymbol_logo"];
    }
    [self.imgHeader ma_setImageWithURL:model.cbackground placeholderImage:[UIImage imageNamed:@"headportrait_logo"]];
    self.lblStatus.text = model.status;
    
    NSString * className = @"";
    if (![MaTool isEmptyStr:model.school_grade]) {
        className = [className stringByAppendingString:model.school_grade];
    }
    if (![MaTool isEmptyStr:model.school_name]) {
        className = [className stringByAppendingString:model.school_name];
    }
    
    if (![MaTool isEmptyStr:model.school_class]) {
        className = [className stringByAppendingString:model.school_class];
    }
    self.lblClass.text = className;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
